package mainfuncs

import (
	"fmt"
	"io/ioutil"
	"net/http"
	"strings"
)

//如果信息收集客户端退出，要即时通知联系人的微信，提示其检查修复bug
func SendToWeixin() {
	resp, err := http.Post("https://sc.ftqq.com/SCU82984T891a3854551b0124cd64d0634414ccd35e4513f5d6101.send",
		"application/x-www-form-urlencoded",
		strings.NewReader("text=LogAgent is exited, please cheack it."))
	if err != nil {
		fmt.Println(err)
	}

	defer resp.Body.Close()
	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		// handle error
	}

	fmt.Println(string(body))
}
